import request from '@/utils/request'

//创建待办事项
export function addTask(data) {
    return request({
        url: '/study/matter/create',
        method: 'post',
        data
    })
}

//更新代办事项
export function updateTask(data) {
    return request({
        url: '/study/matter/update',
        method: 'PUT',
        data
    })
}

//删除代办事项
export function delTask(params) {
    return request({
        url: 'study/matter/delete',
        method: 'DELETE',
        params
    })
}

//获取代办事项列表
export function getMatter() {
    return request({
        url: 'study/matter/page',
        method: 'get',
        data:{pageNo: 1,pageSize: 100}
    })
}

//创建代办事项的任务
export function createMatterTask(data) {
    return request({
        url: '/study/matter/matter-task/create',
        method: 'post',
        data
    })
}

//更新代办事项任务
export function updateMatterTask(data) {
    return request({
        url: '/study/matter/matter-task/update',
        method: 'PUT',
        data
    })
}

//更新代办事项任务z状态
export function updateMatterTaskStatus(data) {
    return request({
        url: '/study/matter/matter-task/updateStatus',
        method: 'PUT',
        data
    })
}

//翻译
export function fakeTranslation(params) {
    return request({
        url: '/study/translate',
        method: 'get',
        params
    })
}

//删除代办事项的任务
export function deleteMatterTask(params) {
    return request({
        url: 'study/matter/matter-task/delete',
        method: 'DELETE',
        params
    })
}

//获得代办事项任务列表
export function getMatterTaskListByMatterId(params) {
    return request({
        url: 'study/matter/matter-task/list-by-matter-id',
        method: 'get',
        params
    })
}

//统计信息
export function getStatistics() {
    return request({
        url: '/study/focus-duration/getStatistics',
        method: 'get',
    })
}
//获取当前用户当前周的专注时长
export function getStatisticsDuration() {
    return request({
        url: '/study/focus-duration/getStatisticsDuration',
        method: 'get',
    })
}

//获取用户专注时长排行榜
export function getStatisticsDurationRank() {
    return request({
        url: '/study/focus-duration/getStatisticsDurationRank',
        method: 'get',
    })
}

//获取用户任务统计
export function getStatisticsTask() {
    return request({
        url: '/study/focus-duration/getStatisticsTask',
        method: 'get',
    })
}

//获取用户任务统计
export function getStatisticsTaskPercentage() {
    return request({
        url: '/study/focus-duration/getStatisticsTaskPercentage',
        method: 'get',
    })
}

//获取音乐
export function getMusic(params) {
    return request({
        url: '/study/music/list',
        method: 'get',
        params
    })
}

//创建专注时长
export function createFocusDuration(data) {
    return request({
        url: '/study/focus-duration/create',
        method: 'post',
        data: data
    })
}





